package android.loaders;

import java.io.InputStream;
import java.util.List;

import android.content.Context;
import android.content.res.Resources;
import android.model.BankItem;
import android.xml.BankHandler;
import android.xml.ItemsParser;
import android.activity.R;

public class BankLoader implements ILoader<BankItem> {

	Resources res;

	public BankLoader(Context ctx) {
		res = ctx.getResources();
	}
	
	@SuppressWarnings("unchecked")
	public List<BankItem> load() throws Exception {
		InputStream is = res.openRawResource(R.raw.bank);
		return (List<BankItem>) ItemsParser.parse(is, new BankHandler());
	}
	

}
